package model.metier;
// Generated 4 mars 2015 13:49:36 by Hibernate Tools 4.3.1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CommandeClient generated by hbm2java
 */
@Entity
@Table(name="commande_client"
    ,catalog="stocks_bdd"
)
public class CommandeClient extends Metier implements java.io.Serializable {


     private Integer id;
     private Client client;
     private Employe employe;
     private Date date;
     private Set<FactureClient> factureClients = new HashSet(0);
     private Set<CommandeClientHasProduit> commandeClientHasProduits = new HashSet(0);

    public CommandeClient() {
    }

	
    public CommandeClient(Client client, Employe employe, Date date) {
        this.client = client;
        this.employe = employe;
        this.date = date;
    }
    public CommandeClient(Client client, Employe employe, Date date, Set<FactureClient> factureClients, Set<CommandeClientHasProduit> commandeClientHasProduits) {
       this.client = client;
       this.employe = employe;
       this.date = date;
       this.factureClients = factureClients;
       this.commandeClientHasProduits = commandeClientHasProduits;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_client", nullable=false)
    public Client getClient() {
        return this.client;
    }
    
    public void setClient(Client client) {
        this.client = client;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_employe", nullable=false)
    public Employe getEmploye() {
        return this.employe;
    }
    
    public void setEmploye(Employe employe) {
        this.employe = employe;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="date", nullable=false, length=19)
    public Date getDate() {
        return this.date;
    }
    
    public void setDate(Date date) {
        this.date = date;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="commandeClient")
    public Set<FactureClient> getFactureClients() {
        return this.factureClients;
    }
    
    public void setFactureClients(Set<FactureClient> factureClients) {
        this.factureClients = factureClients;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="commandeClient")
    public Set<CommandeClientHasProduit> getCommandeClientHasProduits() {
        return this.commandeClientHasProduits;
    }
    
    public void setCommandeClientHasProduits(Set<CommandeClientHasProduit> commandeClientHasProduits) {
        this.commandeClientHasProduits = commandeClientHasProduits;
    }




}


